<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>document2html: src/libs/tools.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">document2html
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Documents to HTML converter</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('tools_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">tools.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="tools_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;mutex&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;pugixml/pugixml.hpp&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacetools.html">tools</a> {</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keyword">using</span> LOCK = std::unique_lock&lt;std::mutex&gt;;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="keyword">extern</span> std::mutex MUTEX;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="namespacetools.html#a51f38bc43c9a878b906703f51cf2f863">IS_WINDOWS</a>;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="namespacetools.html#ade3ce95f9eb4fd3ecf79d48bddc67549">IS_MAC</a>;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    std::string <a class="code" href="namespacetools.html#a08f0fc2373dac29ac2f465e214ad5e8e">getProgramPath</a>();</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    std::string <a class="code" href="namespacetools.html#a279dbca90c35b1c2ffacd5ae992c7de4">absolutePath</a>(<span class="keyword">const</span> std::string&amp; fileName);</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacetools.html#a93d143f93cbc27e9fa0b33ee540cb223">os_rmdir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* dir);</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacetools.html#a78f14ccae7c9f8268d740f27181bfc68">os_mkdir</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* dir);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    std::string <a class="code" href="namespacetools.html#aadd4385b8bfaf6de5ed567c40c4b6862">os_mkdtemp</a>(<span class="keywordtype">char</span>* dir);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="namespacetools.html#aad5d7ef4f195ddf921a9d767ef7c1f83">isDirectory</a>(<span class="keyword">const</span> std::string&amp; path);</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacetools.html#ac746b599f8c902bb76e82c3200fc9562">createDir</a>(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    std::string <a class="code" href="namespacetools.html#aa84f46f23807afb5657576f33866fcb5">createTempDir</a>();</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacetools.html#a038d4029abc7692fb9e6606089d8ca5b">deleteDir</a>(<span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">bool</span> deleteSelf = <span class="keyword">true</span>);</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="namespacetools.html#af03096f8531c055ad3cd70817ea253e0">fileExists</a>(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacetools.html#ab1af504bf51df5e32b8e74b11a94b6b6">moveFile</a>(<span class="keyword">const</span> std::string&amp; oldDir, <span class="keyword">const</span> std::string&amp; oldName,</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                  <span class="keyword">const</span> std::string&amp; newDir, <span class="keyword">const</span> std::string&amp; newName);</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    std::string <a class="code" href="namespacetools.html#a2230fe6af4f64a23efb4c8723848839c">getFileNameFromPath</a>(<span class="keyword">const</span> std::string&amp; path);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    std::string <a class="code" href="namespacetools.html#a812e001de085f32b853874c7d08fa076">getBaseDir</a>(std::string str1, std::string str2);</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacetools.html#a736dbe10baa23bd1f164ee5b9c9893b1">getFileCount</a>(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    std::string <a class="code" href="namespacetools.html#ac16b995cc07db91da70d0f7c14c0447a">trim</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keyword">const</span> std::string&amp; delimiter = <span class="stringliteral">&quot; \t\n\r\0\x0B&quot;</span>);</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    std::wstring <a class="code" href="namespacetools.html#ac16b995cc07db91da70d0f7c14c0447a">trim</a>(<span class="keyword">const</span> std::wstring&amp; str, <span class="keyword">const</span> std::wstring&amp; delimiter = L<span class="stringliteral">&quot; \t\n\r\0\x0B&quot;</span>);</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    std::string <a class="code" href="namespacetools.html#af8e5ba98daed76b7d7e715d4d0139841">ltrim</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keyword">const</span> std::string&amp; delimiter = <span class="stringliteral">&quot; \t\n\r\0\x0B&quot;</span>);</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    std::string <a class="code" href="namespacetools.html#a3f94493c0844d8d9ab256dcb57b0c39c">rtrim</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keyword">const</span> std::string&amp; delimiter = <span class="stringliteral">&quot; \t\n\r\0\x0B&quot;</span>);</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    std::string <a class="code" href="namespacetools.html#ab30cbe8ad8776fddd6e4816ee620366f">lpad</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keywordtype">size_t</span> length, <span class="keywordtype">char</span> filler);</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    std::string <a class="code" href="namespacetools.html#acecb100f4bf2747804ab45555d784594">rpad</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keywordtype">size_t</span> length, <span class="keywordtype">char</span> filler);</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    std::string <a class="code" href="namespacetools.html#ae17fcc35226bbc1ad81d2c490dc0732a">replace</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keyword">const</span> std::string&amp; to, <span class="keywordtype">int</span> offset, <span class="keywordtype">int</span> length);</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacetools.html#a5c56e3d7995198cb7e5dc25cad97f553">replaceAll</a>(std::string&amp; str, <span class="keyword">const</span> std::string&amp; from, <span class="keyword">const</span> std::string&amp; to);</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacetools.html#a5c56e3d7995198cb7e5dc25cad97f553">replaceAll</a>(std::wstring&amp; str, <span class="keyword">const</span> std::wstring&amp; from, <span class="keyword">const</span> std::wstring&amp; to);</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    std::string <a class="code" href="namespacetools.html#a6614cb21fa66108a755cdae14b6a7e35">replaceAll2</a>(std::string str, <span class="keyword">const</span> std::string&amp; from, <span class="keyword">const</span> std::string&amp; to);</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacetools.html#a7e0fdb118719e9f676f159a6840b288f">findNth</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keyword">const</span> <span class="keywordtype">char</span> delimiter, <span class="keyword">const</span> <span class="keywordtype">int</span> occurrence);</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacetools.html#a7e0fdb118719e9f676f159a6840b288f">findNth</a>(<span class="keyword">const</span> std::wstring&amp; str, <span class="keyword">const</span> <span class="keywordtype">wchar_t</span> delimiter, <span class="keyword">const</span> <span class="keywordtype">int</span> occurrence);</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;</div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacetools.html#a7e0fdb118719e9f676f159a6840b288f">findNth</a>(<span class="keyword">const</span> std::wstring&amp; str, <span class="keyword">const</span> std::wstring&amp; delimiter, <span class="keyword">const</span> <span class="keywordtype">int</span> occurrence);</div><div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;</div><div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacetools.html#a4ef59e44bf21c1c81cfa646a57465270">rfindNth</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keyword">const</span> <span class="keywordtype">char</span> delimiter, <span class="keyword">const</span> <span class="keywordtype">int</span> occurrence);</div><div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;</div><div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacetools.html#a4ef59e44bf21c1c81cfa646a57465270">rfindNth</a>(<span class="keyword">const</span> std::wstring&amp; str, <span class="keyword">const</span> <span class="keywordtype">wchar_t</span> delimiter, <span class="keyword">const</span> <span class="keywordtype">int</span> occurrence);</div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;</div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacetools.html#a4ef59e44bf21c1c81cfa646a57465270">rfindNth</a>(<span class="keyword">const</span> std::wstring&amp; str, <span class="keyword">const</span> std::wstring&amp; delimiter, <span class="keyword">const</span> <span class="keywordtype">int</span> occurrence);</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;</div><div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;    std::string <a class="code" href="namespacetools.html#ac03eaa83b0a39beabcb923cb36924026">repeatString</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keywordtype">int</span> times);</div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;</div><div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;    std::vector&lt;std::string&gt; <a class="code" href="namespacetools.html#a0897389c0ea572323c0bf049c7079495">explode</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keyword">const</span> <span class="keywordtype">char</span> delimiter);</div><div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;</div><div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;    std::vector&lt;std::string&gt; <a class="code" href="namespacetools.html#a0897389c0ea572323c0bf049c7079495">explode</a>(std::string str, <span class="keyword">const</span> std::string&amp; delimiterList,</div><div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;                                     <span class="keywordtype">bool</span> skipEmpty = <span class="keyword">false</span>);</div><div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;</div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;    std::string <a class="code" href="namespacetools.html#adec99d68dfd7fb177e484fbe44ca55fc">join</a>(<span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; strList, <span class="keyword">const</span> std::string&amp; delimiter = <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;</div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="namespacetools.html#a7104755a2ae0879f81358d8f68bcde5f">endsWith</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keyword">const</span> std::string&amp; ending);</div><div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;</div><div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;    std::string <a class="code" href="namespacetools.html#a25a60f8bb5dd9a075b021d6a4e438452">xorEncrypt</a>(<span class="keyword">const</span> std::string&amp; str, <span class="keyword">const</span> std::string&amp; key);</div><div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;</div><div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;</div><div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="namespacetools.html#a26aa8d9f909d6c8d11852b37cb5166df">xmlChildrenCount</a>(<span class="keyword">const</span> pugi::xml_node&amp; node, <span class="keyword">const</span> std::string&amp; childName = <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;</div><div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacetools.html#aaf23ee26ba91300dd31ced19280c15da">xmlDeleteAllChildren</a>(pugi::xml_node&amp; node);</div><div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;</div><div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;</div><div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="namespacetools.html#a03bccb109556c3cc851ca881d4227628">sleep</a>(<span class="keywordtype">int</span> time);</div><div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;</div><div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;    std::string <a class="code" href="namespacetools.html#a7eafdc7698deb51a97ce77b18e1df3f7">getTime</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* format = <span class="stringliteral">&quot;%d.%m.%Y %H:%M:%S&quot;</span>);</div><div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;</div><div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;    std::string <a class="code" href="namespacetools.html#a836636e7d8a3ccb5badeaf762c4b42cc">intToHex</a>(<span class="keywordtype">int</span> number, <span class="keywordtype">size_t</span> length);</div><div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;</div><div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;    <span class="keywordtype">char</span> <a class="code" href="namespacetools.html#a672f57c9990f20ef9e912de5ec431a6b">hexCharToDec</a>(<span class="keywordtype">char</span> c);</div><div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;</div><div class="line"><a name="l00571"></a><span class="lineno"><a class="line" href="namespacetools.html#a2a658452f6c56346ee612f3729430e09">  571</a></span>&#160;    <span class="keyword">const</span> std::string <a class="code" href="namespacetools.html#a2a658452f6c56346ee612f3729430e09">PROGRAM_PATH</a> = <a class="code" href="namespacetools.html#a08f0fc2373dac29ac2f465e214ad5e8e">getProgramPath</a>();</div><div class="line"><a name="l00573"></a><span class="lineno"><a class="line" href="namespacetools.html#a30df5ac303ccdb67d423cbbdcf04050d">  573</a></span>&#160;    <span class="keyword">const</span> std::string <a class="code" href="namespacetools.html#a30df5ac303ccdb67d423cbbdcf04050d">TEMP_DIR</a> = PROGRAM_PATH + <span class="stringliteral">&quot;/files/temp&quot;</span>;</div><div class="line"><a name="l00575"></a><span class="lineno"><a class="line" href="namespacetools.html#a0e8f0fd5040d58a6c467fe8ad7ba3657">  575</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="namespacetools.html#a0e8f0fd5040d58a6c467fe8ad7ba3657">HEX_DATA</a>[] = <span class="stringliteral">&quot;0123456789ABCDEF&quot;</span>;</div><div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;</div><div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;}  <span class="comment">// End namespace</span></div><div class="ttc" id="namespacetools_html_a038d4029abc7692fb9e6606089d8ca5b"><div class="ttname"><a href="namespacetools.html#a038d4029abc7692fb9e6606089d8ca5b">tools::deleteDir</a></div><div class="ttdeci">void deleteDir(const std::string &amp;name, bool deleteSelf)</div><div class="ttdoc">Recursively delete directory. </div><div class="ttdef"><b>Definition:</b> tools.cpp:109</div></div>
<div class="ttc" id="namespacetools_html_ab30cbe8ad8776fddd6e4816ee620366f"><div class="ttname"><a href="namespacetools.html#ab30cbe8ad8776fddd6e4816ee620366f">tools::lpad</a></div><div class="ttdeci">std::string lpad(const std::string &amp;str, size_t length, char filler)</div><div class="ttdoc">Pad string to a certain length with another string (from left) </div><div class="ttdef"><b>Definition:</b> tools.cpp:209</div></div>
<div class="ttc" id="namespacetools_html_a7eafdc7698deb51a97ce77b18e1df3f7"><div class="ttname"><a href="namespacetools.html#a7eafdc7698deb51a97ce77b18e1df3f7">tools::getTime</a></div><div class="ttdeci">std::string getTime(const char *format)</div><div class="ttdoc">Get system current time. </div><div class="ttdef"><b>Definition:</b> tools.cpp:430</div></div>
<div class="ttc" id="namespacetools_html_aad5d7ef4f195ddf921a9d767ef7c1f83"><div class="ttname"><a href="namespacetools.html#aad5d7ef4f195ddf921a9d767ef7c1f83">tools::isDirectory</a></div><div class="ttdeci">bool isDirectory(const std::string &amp;path)</div><div class="ttdoc">Check if path is directory. </div><div class="ttdef"><b>Definition:</b> tools.cpp:79</div></div>
<div class="ttc" id="namespacetools_html_a6614cb21fa66108a755cdae14b6a7e35"><div class="ttname"><a href="namespacetools.html#a6614cb21fa66108a755cdae14b6a7e35">tools::replaceAll2</a></div><div class="ttdeci">std::string replaceAll2(std::string str, const std::string &amp;from, const std::string &amp;to)</div><div class="ttdoc">Replace all occurrences of substring. </div><div class="ttdef"><b>Definition:</b> tools.cpp:249</div></div>
<div class="ttc" id="namespacetools_html_a736dbe10baa23bd1f164ee5b9c9893b1"><div class="ttname"><a href="namespacetools.html#a736dbe10baa23bd1f164ee5b9c9893b1">tools::getFileCount</a></div><div class="ttdeci">int getFileCount(const std::string &amp;name)</div><div class="ttdoc">Get amount of files in directory. </div><div class="ttdef"><b>Definition:</b> tools.cpp:162</div></div>
<div class="ttc" id="namespacetools_html_aa84f46f23807afb5657576f33866fcb5"><div class="ttname"><a href="namespacetools.html#aa84f46f23807afb5657576f33866fcb5">tools::createTempDir</a></div><div class="ttdeci">std::string createTempDir()</div><div class="ttdoc">Create temp directory. </div><div class="ttdef"><b>Definition:</b> tools.cpp:103</div></div>
<div class="ttc" id="namespacetools_html_a672f57c9990f20ef9e912de5ec431a6b"><div class="ttname"><a href="namespacetools.html#a672f57c9990f20ef9e912de5ec431a6b">tools::hexCharToDec</a></div><div class="ttdeci">char hexCharToDec(char c)</div><div class="ttdoc">Convert hex char to dec number. </div><div class="ttdef"><b>Definition:</b> tools.cpp:457</div></div>
<div class="ttc" id="namespacetools_html_ae17fcc35226bbc1ad81d2c490dc0732a"><div class="ttname"><a href="namespacetools.html#ae17fcc35226bbc1ad81d2c490dc0732a">tools::replace</a></div><div class="ttdeci">std::string replace(const std::string &amp;str, const std::string &amp;to, int offset, int length)</div><div class="ttdoc">Replace subtring which starts at offset and has size of length </div><div class="ttdef"><b>Definition:</b> tools.cpp:223</div></div>
<div class="ttc" id="namespacetools_html_a3f94493c0844d8d9ab256dcb57b0c39c"><div class="ttname"><a href="namespacetools.html#a3f94493c0844d8d9ab256dcb57b0c39c">tools::rtrim</a></div><div class="ttdeci">std::string rtrim(const std::string &amp;str, const std::string &amp;delimiter)</div><div class="ttdoc">Remove whitespaces and other characters from end of string. </div><div class="ttdef"><b>Definition:</b> tools.cpp:202</div></div>
<div class="ttc" id="namespacetools_html_adec99d68dfd7fb177e484fbe44ca55fc"><div class="ttname"><a href="namespacetools.html#adec99d68dfd7fb177e484fbe44ca55fc">tools::join</a></div><div class="ttdeci">std::string join(const std::vector&lt; std::string &gt; &amp;strList, const std::string &amp;delimiter)</div><div class="ttdoc">Split string by delimiter. </div><div class="ttdef"><b>Definition:</b> tools.cpp:377</div></div>
<div class="ttc" id="namespacetools_html_a26aa8d9f909d6c8d11852b37cb5166df"><div class="ttname"><a href="namespacetools.html#a26aa8d9f909d6c8d11852b37cb5166df">tools::xmlChildrenCount</a></div><div class="ttdeci">int xmlChildrenCount(const pugi::xml_node &amp;node, const std::string &amp;childName)</div><div class="ttdoc">Get XML-node count of children with specific name. </div><div class="ttdef"><b>Definition:</b> tools.cpp:405</div></div>
<div class="ttc" id="namespacetools_html_a7104755a2ae0879f81358d8f68bcde5f"><div class="ttname"><a href="namespacetools.html#a7104755a2ae0879f81358d8f68bcde5f">tools::endsWith</a></div><div class="ttdeci">bool endsWith(const std::string &amp;str, const std::string &amp;ending)</div><div class="ttdoc">Check if string ends with substring. </div><div class="ttdef"><b>Definition:</b> tools.cpp:388</div></div>
<div class="ttc" id="namespacetools_html_aaf23ee26ba91300dd31ced19280c15da"><div class="ttname"><a href="namespacetools.html#aaf23ee26ba91300dd31ced19280c15da">tools::xmlDeleteAllChildren</a></div><div class="ttdeci">void xmlDeleteAllChildren(pugi::xml_node &amp;node)</div><div class="ttdoc">Delete all children. </div><div class="ttdef"><b>Definition:</b> tools.cpp:414</div></div>
<div class="ttc" id="namespacetools_html_a93d143f93cbc27e9fa0b33ee540cb223"><div class="ttname"><a href="namespacetools.html#a93d143f93cbc27e9fa0b33ee540cb223">tools::os_rmdir</a></div><div class="ttdeci">void os_rmdir(const char *dir)</div><div class="ttdoc">Rmdir realisation depending on OS. </div><div class="ttdef"><b>Definition:</b> tools.cpp:67</div></div>
<div class="ttc" id="namespacetools_html_ade3ce95f9eb4fd3ecf79d48bddc67549"><div class="ttname"><a href="namespacetools.html#ade3ce95f9eb4fd3ecf79d48bddc67549">tools::IS_MAC</a></div><div class="ttdeci">const bool IS_MAC</div><div class="ttdef"><b>Definition:</b> tools.cpp:58</div></div>
<div class="ttc" id="namespacetools_html_ab1af504bf51df5e32b8e74b11a94b6b6"><div class="ttname"><a href="namespacetools.html#ab1af504bf51df5e32b8e74b11a94b6b6">tools::moveFile</a></div><div class="ttdeci">void moveFile(const std::string &amp;oldDir, const std::string &amp;oldName, const std::string &amp;newDir, const std::string &amp;newName)</div><div class="ttdoc">Move file. </div><div class="ttdef"><b>Definition:</b> tools.cpp:134</div></div>
<div class="ttc" id="namespacetools_html_a2a658452f6c56346ee612f3729430e09"><div class="ttname"><a href="namespacetools.html#a2a658452f6c56346ee612f3729430e09">tools::PROGRAM_PATH</a></div><div class="ttdeci">const std::string PROGRAM_PATH</div><div class="ttdef"><b>Definition:</b> tools.hpp:571</div></div>
<div class="ttc" id="namespacetools_html_af8e5ba98daed76b7d7e715d4d0139841"><div class="ttname"><a href="namespacetools.html#af8e5ba98daed76b7d7e715d4d0139841">tools::ltrim</a></div><div class="ttdeci">std::string ltrim(const std::string &amp;str, const std::string &amp;delimiter)</div><div class="ttdoc">Remove whitespaces and other characters from begining of string. </div><div class="ttdef"><b>Definition:</b> tools.cpp:195</div></div>
<div class="ttc" id="namespacetools_html_a30df5ac303ccdb67d423cbbdcf04050d"><div class="ttname"><a href="namespacetools.html#a30df5ac303ccdb67d423cbbdcf04050d">tools::TEMP_DIR</a></div><div class="ttdeci">const std::string TEMP_DIR</div><div class="ttdef"><b>Definition:</b> tools.hpp:573</div></div>
<div class="ttc" id="namespacetools_html_a08f0fc2373dac29ac2f465e214ad5e8e"><div class="ttname"><a href="namespacetools.html#a08f0fc2373dac29ac2f465e214ad5e8e">tools::getProgramPath</a></div><div class="ttdeci">std::string getProgramPath()</div><div class="ttdoc">Get current executable file directory to make absolute path. </div><div class="ttdef"><b>Definition:</b> tools.cpp:73</div></div>
<div class="ttc" id="namespacetools_html_a7e0fdb118719e9f676f159a6840b288f"><div class="ttname"><a href="namespacetools.html#a7e0fdb118719e9f676f159a6840b288f">tools::findNth</a></div><div class="ttdeci">int findNth(const std::string &amp;str, const char delimiter, const int occurrence)</div><div class="ttdoc">Find nth occurrence of symbol in string (std::string) </div><div class="ttdef"><b>Definition:</b> tools.cpp:261</div></div>
<div class="ttc" id="namespacetools_html"><div class="ttname"><a href="namespacetools.html">tools</a></div><div class="ttdoc">Helper functions (strings, files, etc.) </div></div>
<div class="ttc" id="namespacetools_html_aadd4385b8bfaf6de5ed567c40c4b6862"><div class="ttname"><a href="namespacetools.html#aadd4385b8bfaf6de5ed567c40c4b6862">tools::os_mkdtemp</a></div><div class="ttdeci">std::string os_mkdtemp(char *dir)</div><div class="ttdoc">Mkdtemp realisation depending on OS. </div><div class="ttdef"><b>Definition:</b> tools.cpp:69</div></div>
<div class="ttc" id="namespacetools_html_acecb100f4bf2747804ab45555d784594"><div class="ttname"><a href="namespacetools.html#acecb100f4bf2747804ab45555d784594">tools::rpad</a></div><div class="ttdeci">std::string rpad(const std::string &amp;str, size_t length, char filler)</div><div class="ttdoc">Pad string to a certain length with another string (from right) </div><div class="ttdef"><b>Definition:</b> tools.cpp:216</div></div>
<div class="ttc" id="namespacetools_html_a4ef59e44bf21c1c81cfa646a57465270"><div class="ttname"><a href="namespacetools.html#a4ef59e44bf21c1c81cfa646a57465270">tools::rfindNth</a></div><div class="ttdeci">int rfindNth(const std::string &amp;str, const char delimiter, const int occurrence)</div><div class="ttdoc">Find nth from right occurrence of symbol in string (std::string) </div><div class="ttdef"><b>Definition:</b> tools.cpp:304</div></div>
<div class="ttc" id="namespacetools_html_a51f38bc43c9a878b906703f51cf2f863"><div class="ttname"><a href="namespacetools.html#a51f38bc43c9a878b906703f51cf2f863">tools::IS_WINDOWS</a></div><div class="ttdeci">const bool IS_WINDOWS</div><div class="ttdef"><b>Definition:</b> tools.cpp:54</div></div>
<div class="ttc" id="namespacetools_html_a03bccb109556c3cc851ca881d4227628"><div class="ttname"><a href="namespacetools.html#a03bccb109556c3cc851ca881d4227628">tools::sleep</a></div><div class="ttdeci">void sleep(int time)</div><div class="ttdoc">Sleep for N sec. </div><div class="ttdef"><b>Definition:</b> tools.cpp:424</div></div>
<div class="ttc" id="namespacetools_html_af03096f8531c055ad3cd70817ea253e0"><div class="ttname"><a href="namespacetools.html#af03096f8531c055ad3cd70817ea253e0">tools::fileExists</a></div><div class="ttdeci">bool fileExists(const std::string &amp;name)</div><div class="ttdoc">Check if file exists. </div><div class="ttdef"><b>Definition:</b> tools.cpp:129</div></div>
<div class="ttc" id="namespacetools_html_a279dbca90c35b1c2ffacd5ae992c7de4"><div class="ttname"><a href="namespacetools.html#a279dbca90c35b1c2ffacd5ae992c7de4">tools::absolutePath</a></div><div class="ttdeci">std::string absolutePath(const std::string &amp;fileName)</div><div class="ttdoc">Get absolute file path. </div><div class="ttdef"><b>Definition:</b> tools.cpp:61</div></div>
<div class="ttc" id="namespacetools_html_a78f14ccae7c9f8268d740f27181bfc68"><div class="ttname"><a href="namespacetools.html#a78f14ccae7c9f8268d740f27181bfc68">tools::os_mkdir</a></div><div class="ttdeci">void os_mkdir(const char *dir)</div><div class="ttdoc">Mkdir realisation depending on OS. </div><div class="ttdef"><b>Definition:</b> tools.cpp:68</div></div>
<div class="ttc" id="namespacetools_html_a5c56e3d7995198cb7e5dc25cad97f553"><div class="ttname"><a href="namespacetools.html#a5c56e3d7995198cb7e5dc25cad97f553">tools::replaceAll</a></div><div class="ttdeci">void replaceAll(std::string &amp;str, const std::string &amp;from, const std::string &amp;to)</div><div class="ttdoc">Replace all occurrences of substring (std::string) </div><div class="ttdef"><b>Definition:</b> tools.cpp:227</div></div>
<div class="ttc" id="namespacetools_html_a836636e7d8a3ccb5badeaf762c4b42cc"><div class="ttname"><a href="namespacetools.html#a836636e7d8a3ccb5badeaf762c4b42cc">tools::intToHex</a></div><div class="ttdeci">std::string intToHex(int number, size_t length)</div><div class="ttdoc">Convert number to hex string. </div><div class="ttdef"><b>Definition:</b> tools.cpp:450</div></div>
<div class="ttc" id="namespacetools_html_a25a60f8bb5dd9a075b021d6a4e438452"><div class="ttname"><a href="namespacetools.html#a25a60f8bb5dd9a075b021d6a4e438452">tools::xorEncrypt</a></div><div class="ttdeci">std::string xorEncrypt(const std::string &amp;str, const std::string &amp;key)</div><div class="ttdoc">Encrypted / decrypted string with XOR method. </div><div class="ttdef"><b>Definition:</b> tools.cpp:394</div></div>
<div class="ttc" id="namespacetools_html_a0897389c0ea572323c0bf049c7079495"><div class="ttname"><a href="namespacetools.html#a0897389c0ea572323c0bf049c7079495">tools::explode</a></div><div class="ttdeci">std::vector&lt; std::string &gt; explode(const std::string &amp;str, const char delimiter)</div><div class="ttdoc">Split string by delimiter. </div><div class="ttdef"><b>Definition:</b> tools.cpp:354</div></div>
<div class="ttc" id="namespacetools_html_ac746b599f8c902bb76e82c3200fc9562"><div class="ttname"><a href="namespacetools.html#ac746b599f8c902bb76e82c3200fc9562">tools::createDir</a></div><div class="ttdeci">void createDir(const std::string &amp;name)</div><div class="ttdoc">Recursively create directory. </div><div class="ttdef"><b>Definition:</b> tools.cpp:85</div></div>
<div class="ttc" id="namespacetools_html_a2230fe6af4f64a23efb4c8723848839c"><div class="ttname"><a href="namespacetools.html#a2230fe6af4f64a23efb4c8723848839c">tools::getFileNameFromPath</a></div><div class="ttdeci">std::string getFileNameFromPath(const std::string &amp;path)</div><div class="ttdoc">Get file name from path (without extension) </div><div class="ttdef"><b>Definition:</b> tools.cpp:141</div></div>
<div class="ttc" id="namespacetools_html_ac16b995cc07db91da70d0f7c14c0447a"><div class="ttname"><a href="namespacetools.html#ac16b995cc07db91da70d0f7c14c0447a">tools::trim</a></div><div class="ttdeci">std::string trim(const std::string &amp;str, const std::string &amp;delimiter)</div><div class="ttdoc">Remove whitespaces and other characters from both sides of string (std::string) </div><div class="ttdef"><b>Definition:</b> tools.cpp:179</div></div>
<div class="ttc" id="namespacetools_html_a812e001de085f32b853874c7d08fa076"><div class="ttname"><a href="namespacetools.html#a812e001de085f32b853874c7d08fa076">tools::getBaseDir</a></div><div class="ttdeci">std::string getBaseDir(std::string str1, std::string str2)</div><div class="ttdoc">Get get base directory for 2 files. </div><div class="ttdef"><b>Definition:</b> tools.cpp:149</div></div>
<div class="ttc" id="namespacetools_html_a0e8f0fd5040d58a6c467fe8ad7ba3657"><div class="ttname"><a href="namespacetools.html#a0e8f0fd5040d58a6c467fe8ad7ba3657">tools::HEX_DATA</a></div><div class="ttdeci">const char HEX_DATA[]</div><div class="ttdef"><b>Definition:</b> tools.hpp:575</div></div>
<div class="ttc" id="namespacetools_html_ac03eaa83b0a39beabcb923cb36924026"><div class="ttname"><a href="namespacetools.html#ac03eaa83b0a39beabcb923cb36924026">tools::repeatString</a></div><div class="ttdeci">std::string repeatString(const std::string &amp;word, int times)</div><div class="ttdoc">Repeat string several times. </div><div class="ttdef"><b>Definition:</b> tools.cpp:346</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_87a455bccb09a92130c26a11a880c98a.html">libs</a></li><li class="navelem"><a class="el" href="tools_8hpp.html">tools.hpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
